class BaseController < ApplicationController
  def index
    
    @destaques = Array.new
    @eventos = Array.new
    
    @destaques = Evento.find(:all, :order => "data", :limit => 5 ,:conditions =>["status = ? AND destaque = ?",true,true])
    @eventos = Evento.find(:all, :order => "data", :limit => 10 ,:conditions =>["status = ? ",true])

  end
  
  def verevento
    @evento = Evento.find(params[:id])
    @comentarios = Comentario.find(:all, :order => "created_at " ,:conditions => ["evento_id = ? AND status = ?",@evento.id,true])
    @comentario = Comentario.new
    @comentario.evento_id = @evento.id
    @comentario.status = true
    @comentario.moderacao = false
  end
  
  def addvou
    @evento = Evento.find(params[:id])
    @evento.vou = @evento.vou + 1
    @evento.save
    redirect_to(:action => "verevento")
  end

  def addnvou
    @evento = Evento.find(params[:id])
    @evento.nvou = @evento.nvou + 1
    @evento.save
    redirect_to(:action => "verevento")
  end


    
 
end
